package com.skit.main.viewmodels

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.skit.common.base.BaseViewModel
import com.skit.common.bean.ActivityBean
import com.skit.common.http.NetResult
import com.skit.main.data.HomeActivityRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class HomeActivityViewModel @Inject constructor(private val repository: HomeActivityRepository) : BaseViewModel() {

    private val _activityLiveData: MutableLiveData<NetResult<List<ActivityBean>>> =
        MutableLiveData()
    val activityLiveData: LiveData<NetResult<List<ActivityBean>>> = _activityLiveData

    fun getActivity(limit: Int, skip: Int, type: Int) {
        netResult({
            repository.getActivity(limit, skip, type)
        }) {
            _activityLiveData.value = it
        }
    }

}